﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZBJF.Warranty.ALiAPI.Model
{

    /// <summary>
    /// 阿里短信模板_抽象类不能用协变和逆变
    /// </summary>
    /// <typeparam name="TModel"></typeparam>
    public interface IALiTemplateParam<out TModel> where TModel : ITemplateModel
    {
        /// <summary>
        /// 短信模板
        /// </summary>
        string TemplateCode { get; }
        /// <summary>
        /// 模板参数
        /// </summary>
        TModel model { get; }
        /// <summary>
        /// 获取短信模板中的变量的序列化字符串
        /// </summary>
        /// <returns></returns>
        string GetTemplateParams();
    }
    /// <summary>
    /// 短信模板参数
    /// </summary>
    public interface ITemplateModel { }


    #region 保险订单审核通知客服
    /// <summary>
    /// 保险订单审核通知客服
    /// </summary>
    public class OrderCheckParam : IALiTemplateParam<OrderCheckModel>
    {
        public OrderCheckParam(OrderCheckModel memberCheckModel)
        {
            this.model = memberCheckModel;
        }

        public string TemplateCode
        {
            get { return "SMS_127163060"; }
        }
        public OrderCheckModel model { get; set; }
        public string GetTemplateParams()
        {
            return JsonConvert.SerializeObject(model);
        }
    }
    /// <summary>
    /// 保险订单审核通知客服
    /// </summary>
    public class OrderCheckModel : ITemplateModel
    {
        /// <summary>
        /// 保险订单审核通知客服
        /// </summary>
        /// <param name="SaleName">销售商名称</param>
        /// <param name="CustomerName">客户名称</param>
        /// <param name="TimeRemaining">剩余审核时间</param>
        public OrderCheckModel(string SaleName, string CustomerName,string TimeRemaining)
        {
            this.SaleName = SaleName;
            this.CustomerName = CustomerName;
            this.TimeRemaining = TimeRemaining;
        }
        /// <summary>
        /// 销售商名称
        /// </summary>
        public string SaleName { get; set; }
        /// <summary>
        /// 客户名称
        /// </summary>
        public string CustomerName { get; set; }
        /// <summary>
        /// 剩余审核时间
        /// </summary>
        public string TimeRemaining { get; set; }
    }
    #endregion


    #region 验证码通知
    /// <summary>
    /// 验证码通知
    /// </summary>
    public class VerificationCodeParam : IALiTemplateParam<VerificationCodeModel>
    {
        public VerificationCodeParam(VerificationCodeModel memberCheckModel)
        {
            this.model = memberCheckModel;
        }
        public string TemplateCode
        {
            get { return "SMS_109355464"; }
        }
        public VerificationCodeModel model { get; set; }
        public string GetTemplateParams()
        {
            return JsonConvert.SerializeObject(model);
        }
    }
    /// <summary>
    /// 验证码通知
    /// </summary>
    public class VerificationCodeModel : ITemplateModel
    {
        /// <summary>
        /// 验证码通知
        /// </summary>
        /// <param name="code">验证码</param>
        public VerificationCodeModel(string code)
        {
            this.code = code;
        }
        /// <summary>
        /// 销售商名称
        /// </summary>
        public string code { get; set; }
    }
    #endregion

    #region 寄回设备通知客户短信模板

    /// <summary>
    /// 寄回设备通知客户短信模板
    /// </summary>
    public class BackEquipmentParam : IALiTemplateParam<BackEquipmentModel>
    {
        public BackEquipmentParam(BackEquipmentModel memberCheckModel)
        {
            this.model = memberCheckModel;
        }
        public string TemplateCode
        {
            get { return "SMS_111555066"; }
        }
        public BackEquipmentModel model { get; set; }
        public string GetTemplateParams()
        {
            return JsonConvert.SerializeObject(model);
        }
    }
    /// <summary>
    /// 寄回设备通知客户短信模板
    /// </summary>
    public class BackEquipmentModel : ITemplateModel
    {
        /// <summary>
        /// 寄回设备通知客户短信模板
        /// </summary>
        /// <param name="code">顺丰快递单号</param>
        public BackEquipmentModel(string ExpressNO)
        {
            this.ExpressNO = ExpressNO;
        }
        /// <summary>
        /// 销售商名称
        /// </summary>
        public string ExpressNO { get; set; }
    }
    #endregion
}
